<!DOCTYPE html><html><head><meta charset="utf-8"><meta content="webkit" name="renderer"/><meta http-equiv="X-UA-Compatible"
content="IE=edge"><meta name="keywords" content="PoweredByJeeSiteV4.0"/><meta http-equiv="Cache-Control"
content="no-cache, no-store, must-revalidate"/><meta name="description" content="PoweredByJeeSiteV4.0"/><meta
content="no-cache" http-equiv="Pragma"/><meta http-equiv="Expires" content="0"/><meta
content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
<title>用户选择 - JeeSite Demo</title>
<script th:src="${setting.domain + 'global.min.js'}"></script>
<script th:src="${setting.domain + 'jquery/jquery-1.12.4.min.js'}"></script>
<script th:src="${setting.domain + 'jquery/jquery-migrate-1.4.1.min.js'}"></script>
<!--[if lt IE 9]><script src="/js/static/common/h5fix.min.js"></script><![endif]-->
<link rel="stylesheet" th:href="${setting.domain + 'fonts/font-icons.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'bootstrap/css/bootstrap.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'select2/4.0/select2.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'icheck/1.0/minimal/grey.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'jqGrid/4.7/css/ui.jqgrid.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'adminlte/css/AdminLTE.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'common/jeesite.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'common/common.css'}">
</head><body class="hold-transition ">
<div class="wrapper"><div class="main-content">
	<div class="box box-main">
		<div class="box-body">
<form id="searchForm" th:action="${setting.domain + 'sys/user/listData'}" method="post" class="form-inline " data-page-no="1" data-page-size="10" data-order-by="">
<input type="hidden" id="status" name="status" value="0"/>
<input type="hidden" id="userType" name="userType" value="employee"/>
				<div class="form-group">
					<label class="control-label">账号：</label>
					<div class="control-inline">
<input type="text" id="loginCode" name="loginCode" value="" maxlength="100" class="form-control width-90"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">昵称：</label>
					<div class="control-inline">
<input type="text" id="userName" name="userName" value="" maxlength="100" class="form-control width-90"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">邮箱：</label>
					<div class="control-inline">
<input type="text" id="email" name="email" value="" maxlength="300" class="form-control width-90"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">手机：</label>
					<div class="control-inline">
<input type="text" id="mobile" name="mobile" value="" maxlength="100" class="form-control width-90"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">电话：</label>
					<div class="control-inline">
<input type="text" id="phone" name="phone" value="" maxlength="100" class="form-control width-90"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">查询</button>
					<button type="reset" class="btn btn-default btn-sm">重置</button>
				</div>
</form>
			<div class="row">
				<div class="col-xs-10 pr10">
					<table id="dataGrid"></table>
					<div id="dataGridPage"></div>
				</div>
				<div class="col-xs-2 pl0">
					<div id="selectData" class="tags-input"></div>
				</div>
			</div>
		</div>
	</div>
</div>
</div>

<a id="scroll-up" href="#" class="btn btn-sm"><i class="fa fa-angle-double-up"></i></a>
<script th:src="${setting.domain + 'bootstrap/js/bootstrap.min.js'}"></script>
<script th:src="${setting.domain + 'select2/4.0/select2.js'}"></script>
<script th:src="${setting.domain + 'select2/4.0/i18n/zh_CN.js'}"></script>
<script th:src="${setting.domain + 'layer/3.1/layer.js'}"></script>
<script th:src="${setting.domain + 'my97/WdatePicker.js'}"></script>
<script th:src="${setting.domain + 'jqGrid/4.7/js/jquery.jqGrid.js'}"></script>
<script th:src="${setting.domain + 'jqGrid/4.7/js/jquery.jqGrid.extend.js'}"></script>
<script th:src="${setting.domain + 'jqGrid/4.7/js/i18n/zh_CN.js'}"></script>
<script th:src="${setting.domain + 'common/jeesite.js'}"></script>
<script th:src="${setting.domain + 'common/i18n/jeesite_zh_CN.js'}"></script>
<script th:src="${setting.domain + 'common/common.js'}"></script>
<script>
var selectData = JSON.parse(js.decodeUrl('{}')),
selectNum = 0, dataGrid = $('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'登录账号', name:'loginCode', index:'a.login_code', width:200, align:"center"},
		{header:'用户昵称', name:'userName', index:'a.user_name', width:200, align:"center"},
		{header:'电子邮箱', name:'email', index:'a.email', width:200, align:"center"},
		{header:'手机号码', name:'mobile', index:'a.mobile', width:200, align:"center"},
		{header:'办公电话', name:'phone', index:'a.phone', width:200, align:"center"},
		{header:'更新时间', name:'updateDate', index:'a.update_date', width:200, align:"center"},
		{header:'状态', name:'status', index:'a.status', width:100, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel([{"id":"1019065439174938624","updateDate":"2018-07-17 11:45","updateBy":"system","createBy":"system","status":"0","createDate":"2018-07-17 11:45","treeSort":20,"treeNames":"正常","parentCodes":"0,","treeLeaf":"1","treeLevel":0,"treeSorts":"0000000020,","dictCode":"1019065439174938624","description":"","cssStyle":"","cssClass":"","dictLabelOrig":"正常","dictValue":"0","dictType":"sys_status","isSys":"1","dictLabel":"正常","isTreeLeaf":true,"isRoot":true,"parentCode":"0"},{"id":"1019065439330127872","updateDate":"2018-07-17 11:45","updateBy":"system","createBy":"system","status":"0","createDate":"2018-07-17 11:45","treeSort":30,"treeNames":"删除","parentCodes":"0,","treeLeaf":"1","treeLevel":0,"treeSorts":"0000000030,","dictCode":"1019065439330127872","description":"","cssStyle":"color:#f00;","cssClass":"","dictLabelOrig":"删除","dictValue":"1","dictType":"sys_status","isSys":"1","dictLabel":"删除","isTreeLeaf":true,"isRoot":true,"parentCode":"0"},{"id":"1019065439481122816","updateDate":"2018-07-17 11:45","updateBy":"system","createBy":"system","status":"0","createDate":"2018-07-17 11:45","treeSort":40,"treeNames":"停用","parentCodes":"0,","treeLeaf":"1","treeLevel":0,"treeSorts":"0000000040,","dictCode":"1019065439481122816","description":"","cssStyle":"color:#f00;","cssClass":"","dictLabelOrig":"停用","dictValue":"2","dictType":"sys_status","isSys":"1","dictLabel":"停用","isTreeLeaf":true,"isRoot":true,"parentCode":"0"},{"id":"1019065439699226624","updateDate":"2018-07-17 11:45","updateBy":"system","createBy":"system","status":"0","createDate":"2018-07-17 11:45","treeSort":50,"treeNames":"冻结","parentCodes":"0,","treeLeaf":"1","treeLevel":0,"treeSorts":"0000000050,","dictCode":"1019065439699226624","description":"","cssStyle":"color:#fa0;","cssClass":"","dictLabelOrig":"冻结","dictValue":"3","dictType":"sys_status","isSys":"1","dictLabel":"冻结","isTreeLeaf":true,"isRoot":true,"parentCode":"0"},{"id":"1019065439875387392","updateDate":"2018-07-17 11:45","updateBy":"system","createBy":"system","status":"0","createDate":"2018-07-17 11:45","treeSort":60,"treeNames":"待审","parentCodes":"0,","treeLeaf":"1","treeLevel":0,"treeSorts":"0000000060,","dictCode":"1019065439875387392","description":"","cssStyle":"","cssClass":"","dictLabelOrig":"待审","dictValue":"4","dictType":"sys_status","isSys":"1","dictLabel":"待审","isTreeLeaf":true,"isRoot":true,"parentCode":"0"},{"id":"1019065440022188032","updateDate":"2018-07-17 11:45","updateBy":"system","createBy":"system","status":"0","createDate":"2018-07-17 11:45","treeSort":70,"treeNames":"驳回","parentCodes":"0,","treeLeaf":"1","treeLevel":0,"treeSorts":"0000000070,","dictCode":"1019065440022188032","description":"","cssStyle":"","cssClass":"","dictLabelOrig":"驳回","dictValue":"5","dictType":"sys_status","isSys":"1","dictLabel":"驳回","isTreeLeaf":true,"isRoot":true,"parentCode":"0"},{"id":"1019065440210931712","updateDate":"2018-07-17 11:45","updateBy":"system","createBy":"system","status":"0","createDate":"2018-07-17 11:45","treeSort":80,"treeNames":"草稿","parentCodes":"0,","treeLeaf":"1","treeLevel":0,"treeSorts":"0000000080,","dictCode":"1019065440210931712","description":"","cssStyle":"color:#aaa;","cssClass":"","dictLabelOrig":"草稿","dictValue":"9","dictType":"sys_status","isSys":"1","dictLabel":"草稿","isTreeLeaf":true,"isRoot":true,"parentCode":"0"}], val, '未知', true);
		}},
		{header:'行数据', name:'rowData', hidden:true, formatter: function(val, obj, row, act){
			return JSON.stringify(row);
		}}
	],
	autoGridHeight: function(){
		var height = $(window).height() - $('#searchForm').height() - $('#dataGridPage').height() - 73;
		$('.tags-input').height($('.ui-jqgrid').height() - 10);
		return height;
	},
	showCheckbox: '' == 'true',
	multiboxonly: false, // 单击复选框时再多选
	ajaxSuccess: function(data){
		$.each(selectData, function(key, value){
			dataGrid.dataGrid('setSelectRow', key);
		});
		initSelectTag();
	},
	onSelectRow: function(id, isSelect, event){
		if ('' == 'true'){
			if(isSelect){
				selectData[id] = JSON.parse(dataGrid.dataGrid('getRowData', id).rowData);
			}else{
				delete selectData[id];
			}
		}else{
			selectData = {};
			selectData[id] = JSON.parse(dataGrid.dataGrid('getRowData', id).rowData);
		}
		initSelectTag();
	},
	onSelectAll: function(ids, isSelect){
		if ('' == 'true'){
			for (var i=0; i<ids.length; i++){
				if(isSelect){
					selectData[ids[i]] = JSON.parse(dataGrid.dataGrid('getRowData', ids[i]).rowData);
				}else{
					delete selectData[ids[i]];
				}
			}
		}
		initSelectTag();
	},
	ondblClickRow: function(id, rownum, colnum, event){
		if ('' != 'true'){
			js.layer.$('#' + window.name).closest('.layui-layer')
				.find(".layui-layer-btn0").trigger("click");
		}
		initSelectTag();
	}
});
function initSelectTag(){
	selectNum = 0;
	var html = [];
	$.each(selectData, function(key, value){
		selectNum ++;
		html.push('<span class="tag" id="'+key+'_tags-input"><span>'+value.userName+' </span>'
			+ '<a href="#" onclick="removeSelectTag(\''+key+'\');" title="取消选择">x</a></span>');
	});
	html.unshift('<div class="title">当前已选择<span id="selectNum">'+selectNum+'</span>项：</div>');
	$('#selectData').empty().append(html.join(''));
}
function removeSelectTag(key){
	delete selectData[key];
	dataGrid.dataGrid('resetSelection', key);
	$('#selectNum').html(--selectNum);
	$('#'+key+'_tags-input').remove();
}
function getSelectData(){
	return selectData;
}
</script>